package com.lening.organization.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseServiceImpl;
import com.lening.organization.dto.PostRoleDTO;
import com.lening.organization.mapper.PeopleMapper;
import com.lening.organization.dto.PeopleDTO;
import com.lening.organization.po.People;
import com.lening.organization.service.PeopleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class PeopleServiceImpl extends BaseServiceImpl<PeopleMapper, People, PeopleDTO> implements PeopleService {

    @Resource
    private PeopleMapper peopleMapper;

    @Override
    public Page<People> findPeople(Integer pageNum, Integer pageSize, Page<PeopleDTO> peopleDTO) {
        Page<People> page = peopleMapper.findPeople(pageNum, pageSize, peopleDTO);
        return page;
    }

    @Override
    public void addUserRole(PostRoleDTO postRoleDTO) {
        peopleMapper.addUserRole(postRoleDTO);
    }
}
